<?php
/**
 * Created by PhpStorm.
 * User: mr_lee
 * Date: 2017/10/16
 * Time: 下午4:13
 */

namespace app\merchant\controller;


use app\common\controller\ActionLogs;
use app\common\controller\AdminBase;
use app\common\controller\WnObjApi;
use app\common\model\Agent;
use app\common\model\MchStatis;
use app\common\model\Merchant;
use app\common\model\Paylog;
use app\common\model\Tklog;
use app\common\model\WxOpen;
use think\Request;
use Wechat\Wxobjopen;


class Payextend extends AdminBase
{

    //交易查询
    public function order_query()
    {
        if (request()->isAjax()) {
            $request = request();
            $param = $request->param();
            $Paylog = new Paylog();
            $map1['orderid'] = $param['orderid'];
//            $map1['pay_fs'] = ['in',[0,2]];
            $payinfo = $Paylog->where($map1)->find();
            if ($payinfo) {
                $WnObjApi = new WnObjApi();
                $res_array = $WnObjApi->wn_order_query($payinfo);
            }else{
                $res_array['return_code'] = "FAIL";
                $res_array['return_msg'] = "查询失败";
            }
            return json($res_array);
        }
    }

}